﻿<%@ LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Option Explicit %>
<% 'On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<!-- #include file="..\..\c_option.asp" -->
<!-- #include file="..\..\..\zb_system\function\c_function.asp" -->
<!-- #include file="..\..\..\zb_system\function\c_system_lib.asp" -->
<!-- #include file="..\..\..\zb_system\function\c_system_base.asp" -->
<!-- #include file="..\..\..\zb_system\function\c_system_event.asp" -->
<!-- #include file="..\..\..\zb_system\function\c_system_manage.asp" -->
<!-- #include file="..\..\..\zb_system\function\c_system_plugin.asp" -->
<!-- #include file="..\p_config.asp" -->
<%
Call System_Initialize()
Call BackupDBPro_Initialize
'检查非法链接
Call CheckReference("")
'检查权限
If BlogUser.Level>1 Then Call ShowError(6)
If CheckPluginState("BackupDBPro")=False Then Call ShowError(48)
BlogTitle="数据库备份 Pro"

If Request.QueryString("act")="backupmssql" Then
	Call BackupDBPro_Mssql("backup",Request.Form("item"))
	Call SetBlogHint(True,True,False)
	Response.Redirect "main.asp"
End If
If Request.QueryString("act")="restoremssql" Then
	Call BackupDBPro_Mssql("restore",Request.Form("item"))
	Response.Redirect "main.asp"
End If
If Request.QueryString("act")="backupaccess" Then
	Call BackupDBPro_Access(Request.Form("item"))
	Call SetBlogHint(True,True,False)
	Response.Redirect "main.asp"
End If
If Request.QueryString("act")="saveconfig" Then
	Call BackupDBPro_SaveConfig
	Call SetBlogHint(True,True,False)
	Response.Redirect "main.asp"
End If
%>
<!--#include file="..\..\..\zb_system\admin\admin_header.asp"-->
<!--#include file="..\..\..\zb_system\admin\admin_top.asp"-->
	<div id="divMain">
	  <div id="ShowBlogHint">
		<%Call GetBlogHint()%>
	  </div>
	  <div class="divHeader"><%=BlogTitle%></div>
	  <div class="SubMenu"></div>
	  <div id="divMain2">
		<script type="text/javascript">ActiveTopMenu("aPlugInMng");</script>
		<div class="content-box">
			<div class="content-box-header">
				<ul class="content-box-tabs">
					<li><a href="#fragment-1" class="default-tab"><span>设置与说明</span></a></li>
					<%If ZC_MSSQL_ENABLE=True Then%>
					<li><a href="#fragment-2"><span>MSSQL手动备份</span></a></li>
					<!--<li><a href="#fragment-3"><span>MSSQL恢复备份</span></a></li>-->
					<%Else%>
					<li><a href="#fragment-4"><span>ACCESS手动备份</span></a></li>
					<%End If%>
				</ul>
				<div class="clear"></div>
			</div>
			<div class="content-box-content">
				<div class="tab-content default-tab" style="border:none;padding:0px;margin:0;" id="fragment-1">
					<form name="form0" method="post" action="?act=saveconfig">
					<p>1. 数据库备份 Pro 同时支持备份MSSQL和ACCESS数据库，以及自动备份。<br />
					2. 自动备份在用户登录后台时检查最后一次备份时间，若符合备份频率则进行自动备份。<br />
					3. 手动备份时自动备份位置不可选，每个备份位置对应一个备份文件，不必担心冗余数据。</p>
					<p>自动备份<input type="text" name="on" class="checkbox" value="<%=BackupDBPro_On%>" /> <span style="padding-left:15px;">备份频率 <input type="text" name="interval" value="<%=BackupDBPro_Interval%>" size="2" /><span style="color:#a8a8a8;margin:0 3px 0 -20px;">天</span></span></p>
					<p><input name="submit0" type="submit" size="10" value="确定" /></p>
					</form>
				</div>
				<%If ZC_MSSQL_ENABLE=True Then%>
				<div class="tab-content" style="border:none;padding:0px;margin:0;" id="fragment-2">
					<form name="form1" method="post" action="?act=backupmssql">
					<p>请选择备份位置，自动备份不可选。数据库备份文件目录：/zb_users/DATA/。</p>
					<p><input type="radio" name="item" id="bitem1" value="1" disabled required="required" /><label for="bitem1">自动备份(<%=BackupDBPro_Backup1%>)</label></p>
					<p><input type="radio" name="item" id="bitem2" value="2" required="required" checked /><label for="bitem2">备份2(<%=BackupDBPro_Backup2%>)</label></p>
					<p><input type="radio" name="item" id="bitem3" value="3" required="required" /><label for="bitem3">备份3(<%=BackupDBPro_Backup3%>)</label></p>
					<p><input name="submit1" type="submit" size="10" value="确定" /></p>
					</form>
				</div>
				<div class="tab-content" style="border:none;padding:0px;margin:0;" id="fragment-3">
					<form name="form2" method="post" action="?act=restoremssql">
					<p><input type="radio" name="item" id="ritem1" value="1" required="required" /><label for="ritem1">自动备份(<%=BackupDBPro_Backup1%>)</label></p>
					<p><input type="radio" name="item" id="ritem2" value="2" required="required" /><label for="ritem2">备份2(<%=BackupDBPro_Backup2%>)</label></p>
					<p><input type="radio" name="item" id="ritem3" value="3" required="required" /><label for="ritem3">备份3(<%=BackupDBPro_Backup3%>)</label></p>
					<p><input name="submit2" type="submit" size="10" value="确定" /></p>
					</form>
				</div>
				<%Else%>
				<div class="tab-content" style="border:none;padding:0px;margin:0;" id="fragment-4">
					<form name="form3" method="post" action="?act=backupaccess">
					<p>请选择备份位置，自动备份不可选。数据库备份文件目录：/zb_users/DATA/。</p>
					<p><input type="radio" name="item" id="aitem1" value="1" disabled required="required" /><label for="aitem1">自动备份(<%=BackupDBPro_Backup1%>)</label></p>
					<p><input type="radio" name="item" id="aitem2" value="2" required="required" checked /><label for="aitem2">备份2(<%=BackupDBPro_Backup2%>)</label></p>
					<p><input type="radio" name="item" id="aitem3" value="3" required="required" /><label for="aitem3">备份3(<%=BackupDBPro_Backup3%>)</label></p>
					<p><input name="submit1" type="submit" size="10" value="确定" /></p>
					</form>
				</div>
				<%End If%>
			</div>
		</div>
	  </div>
	</div>
	<!--#include file="..\..\..\zb_system\admin\admin_footer.asp"-->

<%Call System_Terminate()%>